/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.JTable;
import view.BorrowDocumentView;

/**
 *
 * @author Ira
 */
public class BorrowDocumentController implements MouseListener  {

	private BorrowDocumentView view;
	
	public BorrowDocumentController(BorrowDocumentView view) {
		this.view = view;
	}
	
	@Override
	public void mouseClicked(MouseEvent e) {
		String name = ((JTable)e.getSource()).getName();
		if(name.equals(BorrowDocumentView.TAB_BORROW)) {
			this.view.updateObservers(Boolean.TRUE);
		}
		else if(name.equals(BorrowDocumentView.TAB_RESERVE)) {
			this.view.updateObservers(Boolean.FALSE);
		}
	}

	@Override
	public void mousePressed(MouseEvent e) {
		
	}

	@Override
	public void mouseReleased(MouseEvent e) {
		
	}

	@Override
	public void mouseEntered(MouseEvent e) {
		
	}

	@Override
	public void mouseExited(MouseEvent e) {
		
	}
	
}
